import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/access_record/access_record_controller.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/access_record/assess/cars.dart';
import 'package:enterprise_v6_app/app/modules/application/closure/access_record/assess/personnel.dart';

/// 出入记录
class AccessRecordPage extends StatelessWidget {
  AccessRecordPage({super.key});

  final controller = Get.put(AccessRecordController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
      init: controller,
      builder: (_) {
        return DefaultTabController(
          length: 2,
          child: Column(
            children: [
              Container(
                padding: EdgeInsets.symmetric(horizontal: 6.w),
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(8),
                ),
                height: AppDimens.dp54,
                child: TabBar(
                  tabs: const [
                    Tab(text: '人员'),
                    Tab(text: '车辆'),
                  ],
                  dividerColor: Colors.transparent,
                  labelPadding: EdgeInsets.only(bottom: 10.w, left: 6.w, right: 6.w),
                  labelStyle: TextStyle(
                    fontSize: 16.sp,
                    fontWeight: FontWeight.w500,
                  ),
                  unselectedLabelStyle: TextStyle(
                    fontSize: 16.sp,
                    fontWeight: FontWeight.w500,
                  ),
                  labelColor: Colors.black,
                  unselectedLabelColor: const Color(0xffA0A7B5),
                  indicatorPadding: EdgeInsets.only(top: 36.w, bottom: 10.w),
                  indicator: const BoxDecoration(
                    image: DecorationImage(
                      image: AssetImage(
                        AppImages.icon_app_work_plan,
                      ),
                    ),
                  ),
                ),
              ),
              Expanded(
                  child: Container(
                    color: const Color(0xffF5F5F6),
                    child: TabBarView(
                      children: [
                        PersonnelAccess(),
                        CarAssess(),
                      ],
                    ),
                  )),
            ],
          ),
        );
      },
    );
  }
}
